<?xml version="1.0"?>
<doc>
    <assembly>
        <name>Source</name>
    </assembly>
    <members>
        <member name="T:AmbientSingleton">
            <summary>
            Provides convenience factory methods for <see cref="T:AmbientSingleton`1"/> 
            so that type inference can be leveraged for the given default value. There 
            is no need to specify the T parameter for the Create method overloads.
            </summary>
        </member>
        <member name="M:AmbientSingleton.Create``1(System.String)">
            <summary>
            Creates an ambient singleton with no default value and a specific identifier.
            </summary>
            <typeparam name="T">Type of value held by the singleton.</typeparam>
            <param name="identifier">An identifier for the created singleton. Allows to reuse the ambient "variable" if needed.</param>
        </member>
        <member name="M:AmbientSingleton.Create``1(System.Guid)">
            <summary>
            Creates an ambient singleton with no default value and a specific identifier.
            </summary>
            <typeparam name="T">Type of value held by the singleton.</typeparam>
            <param name="identifier">An identifier for the created singleton. Allows to reuse the ambient "variable" if needed.</param>
        </member>
        <member name="M:AmbientSingleton.Create``1(``0)">
            <summary>
            Creates an ambient singleton with the specified default value.
            </summary>
            <typeparam name="T">Type of value held by the singleton. No need to specify it explicitly.</typeparam>
            <param name="defaultValue">The default value for the singleton.</param>
        </member>
        <member name="M:AmbientSingleton.Create``1(System.Func{``0})">
            <summary>
            Creates an ambient singleton with the specified default value factory.
            </summary>
            <typeparam name="T">Type of value held by the singleton. No need to specify it explicitly.</typeparam>
            <param name="defaultValueFactory">The default value factory for the singleton.</param>
        </member>
        <member name="M:AmbientSingleton.Create``1(``0,System.Guid)">
            <summary>
            Creates an ambient singleton with the specified default value and identifier.
            </summary>
            <typeparam name="T">Type of value held by the singleton. No need to specify it explicitly.</typeparam>
            <param name="defaultValue">The default value for the singleton.</param>
            <param name="identifier">An identifier for the created singleton. Allows to reuse the ambient "variable" if needed.</param>
        </member>
        <member name="M:AmbientSingleton.Create``1(``0,System.String)">
            <summary>
            Creates an ambient singleton with the specified default value and identifier.
            </summary>
            <typeparam name="T">Type of value held by the singleton. No need to specify it explicitly.</typeparam>
            <param name="defaultValue">The default value for the singleton.</param>
            <param name="identifier">An identifier for the created singleton. Allows to reuse the ambient "variable" if needed.</param>
        </member>
        <member name="M:AmbientSingleton.Create``1(System.Func{``0},System.Guid)">
            <summary>
            Creates an ambient singleton with the specified default value factory.
            </summary>
            <typeparam name="T">Type of value held by the singleton. No need to specify it explicitly.</typeparam>
            <param name="defaultValueFactory">The default value factory for the singleton.</param>
            <param name="identifier">An identifier for the created singleton. Allows to reuse the ambient "variable" if needed.</param>
        </member>
        <member name="M:AmbientSingleton.Create``1(System.Func{``0},System.String)">
            <summary>
            Creates an ambient singleton with the specified default value factory.
            </summary>
            <typeparam name="T">Type of value held by the singleton. No need to specify it explicitly.</typeparam>
            <param name="defaultValueFactory">The default value factory for the singleton.</param>
            <param name="identifier">An identifier for the created singleton. Allows to reuse the ambient "variable" if needed.</param>
        </member>
        <member name="T:AmbientSingleton`1">
            <summary>
            Provides an easy way to implement the singleton (anti?) pattern so that it is ambient-safe,
            propagates with a call context and can be overriden per ambient (i.e. in tests).
            </summary>
            <typeparam name="T">The type of value exposed as an ambient singleton.</typeparam>
            <remarks>
            This class is used to implement singletons that can be replaced in tests and are thread-safe 
            for that scenario. A default value can be provided as a fallback if no ambient-specific value 
            has been set prior to usage (i.e. a default singleton implementation).
            <example>
            The following example shows how to use the ambient singleton to define a singleton 
            clock:
            <code>
            public class SystemClock : IClock
            {
            	private static AmbientSingleton&lt;IClock&gt; singleton;
            		
            	static SystemClock()
            	{
            		singleton = new AmbientSingleton&lt;IClock&gt;(new SystemClock());
            	}
            
            	private SystemClock()
            	{
            		// Can only be instantiated once and only by us.
            	}
            
            	public static IClock Instance 
            	{ 
            		get { return singleton.Value; } 
            		// Made internal so that only our tests can replace this value
            		internal set { singleton.Value = value; }
            	}
            	
            	public DateTimeOffset Now { get { return DateTimeOffset.Now; } }
            }
            </code>
            A consumer domain class might use like as follows:
            <code>
            var now = SystemClock.Instance.Now;
            </code>
            A test could replace the value of Now by simply replacing the singleton:
            <code>
            SystemClock.Instance = mockClock;
            
            // Would now use the mocked clock automatically from the replaced 
            // ambient singleton
            obj.PerformOperation();
            </code>
            </example>
            </remarks>
            <nuget id="netfx-System.AmbientSingleton"/>
        </member>
        <member name="M:AmbientSingleton`1.#ctor(System.Guid)">
            <summary>
            Initializes a new instance of the <see cref="T:AmbientSingleton`1"/> class 
            without a local default and a specific identifier.
            </summary>
            <param name="identifier">An identifier for the created singleton. Allows to reuse the ambient "variable" if needed.</param>
        </member>
        <member name="M:AmbientSingleton`1.#ctor">
            <summary>
            Initializes a new instance of the <see cref="T:AmbientSingleton`1"/> class 
            without a local default, meaning that if no value is assigned 
            to the <see cref="P:AmbientSingleton`1.Value"/> property, it will return the default 
            value for the type.
            </summary>
        </member>
        <member name="M:AmbientSingleton`1.#ctor(`0)">
            <summary>
            Initializes a new instance of the <see cref="T:AmbientSingleton`1"/> class 
            with a global default value. This value will be returned by the <see cref="P:AmbientSingleton`1.Value"/> 
            property if no other value has been set in the current call context.
            </summary>
            <param name="defaultValue">The default value for the singleton.</param>
        </member>
        <member name="M:AmbientSingleton`1.#ctor(`0,System.Guid)">
            <summary>
            Initializes a new instance of the <see cref="T:AmbientSingleton`1"/> class 
            with a global default value. This value will be returned by the <see cref="P:AmbientSingleton`1.Value"/> 
            property if no other value has been set in the current call context.
            </summary>
            <param name="defaultValue">The default value for the singleton.</param>
            <param name="identifier">An identifier for the created singleton. Allows to reuse the ambient "variable" if needed.</param>
        </member>
        <member name="M:AmbientSingleton`1.#ctor(`0,System.String)">
            <summary>
            Initializes a new instance of the <see cref="T:AmbientSingleton`1"/> class 
            with a global default value. This value will be returned by the <see cref="P:AmbientSingleton`1.Value"/> 
            property if no other value has been set in the current call context.
            </summary>
            <param name="defaultValue">The default value for the singleton.</param>
            <param name="identifier">An identifier for the created singleton. Allows to reuse the ambient "variable" if needed.</param>
        </member>
        <member name="M:AmbientSingleton`1.#ctor(System.Func{`0})">
            <summary>
            Initializes a new instance of the <see cref="T:AmbientSingleton`1"/> class 
            with a global default value factory. This factory will be called once the first 
            time the global default value is accessed, such as if no other value has been 
            set in the current call context for the <see cref="P:AmbientSingleton`1.Value"/> property.
            </summary>
            <param name="defaultValueFactory">The default value factory for the singleton.</param>
        </member>
        <member name="M:AmbientSingleton`1.#ctor(System.Func{`0},System.Guid)">
            <summary>
            Initializes a new instance of the <see cref="T:AmbientSingleton`1"/> class 
            with a global default value factory. This factory will be called once the first 
            time the global default value is accessed, such as if no other value has been 
            set in the current call context for the <see cref="P:AmbientSingleton`1.Value"/> property.
            </summary>
            <param name="defaultValueFactory">The default value factory for the singleton.</param>
            <param name="identifier">An identifier for the created singleton. Allows to reuse the ambient "variable" if needed.</param>
        </member>
        <member name="M:AmbientSingleton`1.#ctor(System.Func{`0},System.String)">
            <summary>
            Initializes a new instance of the <see cref="T:AmbientSingleton`1"/> class 
            with a global default value factory. This factory will be called once the first 
            time the global default value is accessed, such as if no other value has been 
            set in the current call context for the <see cref="P:AmbientSingleton`1.Value"/> property.
            </summary>
            <param name="defaultValueFactory">The default value factory for the singleton.</param>
            <param name="identifier">An identifier for the created singleton. Allows to reuse the ambient "variable" if needed.</param>
        </member>
        <member name="P:AmbientSingleton`1.Value">
            <summary>
            Gets or sets the value of the ambient singleton.
            </summary>
            <remarks>
            Setting the value will only change the specified 
            default value in the constructor for the current 
            call context.
            </remarks>
        </member>
        <member name="T:Guard">
            <summary>
            Common guard class for argument validation.
            </summary>
        </member>
        <member name="M:Guard.NotNull``1(System.Linq.Expressions.Expression{System.Func{``0}},``0)">
            <summary>
            Ensures the given <paramref name="value"/> is not null.
            Throws <see cref="T:System.ArgumentNullException"/> otherwise.
            </summary>
        </member>
        <member name="M:Guard.NotNullOrEmpty(System.Linq.Expressions.Expression{System.Func{System.String}},System.String)">
            <summary>
            Ensures the given string <paramref name="value"/> is not null or empty.
            Throws <see cref="T:System.ArgumentNullException"/> in the first case, or 
            <see cref="T:System.ArgumentException"/> in the latter.
            </summary>
        </member>
    </members>
</doc>
